package com.test.common;

import java.util.concurrent.atomic.AtomicReference;

public class Cache<K, V> {
    private AtomicReference<K> k = new AtomicReference<>();
    private AtomicReference<V> v = new AtomicReference<>();

    public V get(K k) {
        if (this.k.equals(k)) {
            return v.get();
        }
        return null;
    }

    public void put(K k, V v) {
        this.k.set(k);
        this.v.set(v);
    }
}
